package com.getword.service;

import com.getword.domain.User;
import com.getword.web.model.Result;
import com.getword.web.model.UserQueryCondition;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

public interface UserService {
    /**
     * 添加用户信息
     * @param user
     * @return
     */
    Result addUser(User user);
    Result updateUser(User user);
    Result getUsers();

    Result count();

    Result login(User user);
    /**
     * 修改密码
     */
    Result updatePwd(String oldPwd, String pwd);

    Result uploadHead(MultipartFile file);

    Result getLoginUser();

    /**
     * 获取登陆用户的文章数量
     * @return
     */
    Result getArticleCountOfUser(Long userId);

    Result getCount(User user);

    /**
     * 用户分页查询
     * @param page
     * @param user
     * @return
     */
    Result getUserPage(Pageable page, User user);

    /**
     * 查询用户名是否存在
     * @param loginName
     * @return
     */
    Result checkLoginName(String loginName);

    Result uploadImg(MultipartFile file, String token);
}
